<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>
<style>
    .form-group.row{
        margin-left: 10px;
        user-select: none;
    }
</style>
<form class="card">
    <div class="card-body">
        <h4>
            一键分享设置
            <a href="https://zhaolindev.com" target="_blank"><img class="float-right" height="30px" src="/plugin/zl_vaptcha/static/logo.png" alt=""> </a>
        </h4>
        <div class="alert alert-warning" role="alert">
            <div>本插件由召灵社区出品，请认准官方网站：
                <a href="https://zhaolindev.com" target="_blank">zhaolindev.com</a>
            </div>
            <div>请勿使用盗版应用，产生的一切问题本站概不负责。</div>
        </div>
        <div class="alert alert-success msg" style="display: none">
        </div>
        <h5>选择开启的社交方式</h5>
        <div class="form-group row">
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['qzone'])) {?> checked
                <?php }?> type="checkbox" name="qzone" id="qzone">
                <label class="form-check-label" for="qzone">
                    QQ空间
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['qq'])) {?> checked
                <?php }?> type="checkbox" name="qq" id="qq">
                <label class="form-check-label" for="qq">
                    QQ
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['tencent'])) {?> checked
                <?php }?> type="checkbox" name="tencent" id="tencent">
                <label class="form-check-label" for="tencent">
                    腾讯微博
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['weibo'])) {?> checked
                <?php }?> type="checkbox" name="weibo" id="weibo">
                <label class="form-check-label" for="weibo">
                    微博
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['wechat'])) {?> checked
                <?php }?> type="checkbox" name="wechat" id="wechat">
                <label class="form-check-label" for="wechat">
                    微信
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['douban'])) {?> checked
                <?php }?> type="checkbox" name="douban" id="douban">
                <label class="form-check-label" for="douban">
                    豆瓣
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['diandian'])) {?> checked
                <?php }?> type="checkbox" name="diandian" id="diandian">
                <label class="form-check-label" for="diandian">
                    点点
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['linkedin'])) {?> checked
                <?php }?> type="checkbox" name="linkedin" id="linkedin">
                <label class="form-check-label" for="linkedin">
                    LinkedIn
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['facebook'])) {?> checked
                <?php }?> type="checkbox" name="facebook" id="facebook">
                <label class="form-check-label" for="facebook">
                    Facebook
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['twitter'])) {?> checked
                <?php }?> type="checkbox" name="twitter" id="twitter">
                <label class="form-check-label" for="twitter">
                    Twitter
                </label>
            </div>
            <div class="col-sm-2">
                <input class="form-check-input" <?php if(!empty($config['google'])) {?> checked
                <?php }?> type="checkbox" name="google" id="google">
                <label class="form-check-label" for="google">
                    Google
                </label>
            </div>
        </div>

        <div class="form-group">
            <button class="btn btn-success submit" type="button">保存</button>
        </div>
    </div>
</form>
<script src="../view/js/jquery-3.3.1.js<?php echo $static_version;?>"></script>
<script>
    var timer = null;
    $('.submit').click(function () {
        $.post('', $('form').serialize(), function (r) {
            if (r && r.code === 1) {
                $('.msg').text('修改成功').show();
            } else {
                $('.msg').text(JSON.stringify(r)).show();
            }
            timer && clearTimeout(timer);
            timer = setTimeout(function() {
                $('.msg').hide();
            }, 1500)
        }, 'json')
    })
</script>